home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10057 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  45 lines

  1. Path: teamserve.paradigm.co.za!not-for-mail
  2. From: jfk@teamserve.paradigm.co.za (Jan Kaluza)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How do you reset the computer using C on a PC ?
  5. Date: 15 Mar 1996 11:09:56 GMT
  6. Organization: No organisation supplied
  7. Distribution: world
  8. Message-ID: <4ibj64$u2@hermes.is.co.za>
  9. References: <31473FD4.48AA@ccis.com> <Pine.A32.3.91.960313183048.180818A-100000@red.weeg.uiowa.edu>
  10. NNTP-Posting-Host: teamserve.paradigm.co.za
  11. X-Newsreader: TIN [UNIX 1.3 950515BETA PL0]
  12.  
  13. The Amorphous Mass (robinson@blue.weeg.uiowa.edu) wrote:
  14. : On Wed, 13 Mar 1996, Derek Lund wrote:
  15. : > Help?
  16. : int main(void)
  17. : {
  18. :     printf("press ctrl-alt-del.");
  19. :     return 0;
  20. : }
  21. :   For a more useful answer, try comp.os.msdos.programmer.help (or 
  22. : comp.os.ms-windows.programmer, etc).
  23. : /**James Robinson***********************            
  24. :   "If a fatal error occurs, the program should not be allowed to continue."
  25. :  -- Oracle Pro*C User's Guide         *************james-robinson@uiowa.edu**/
  26.  
  27. More seriously: when you want to reset the PC, call this function:
  28.  
  29. void resetPC(void) {
  30.   struct REGPACK rr;
  31.   intr(25,&rr);
  32. }
  33.  
  34. This works for Turbo C/Borland C. For other compilers there must be an 
  35. equivalent.  Interrupt 25 resets the PC in DOS. I found it hangs up a
  36. DOS session in Windows rather nastily. 
  37. -- 
  38. Jan KALUZA: jfk@paradigm.co.za         [Box 4687, The Reeds, 0158, RSA] |Psalm
  39. Genghis Janus (Std Disclaimer: My views are mine, mine and mine again!) |97:11
  40. Light is sown as seed for the righteous and gladness for the upright in heart.
  41.